package com.cskaoyan._06intern;

/**
 * @description:
 * @author: 景天
 * @date: 2023/2/16 15:09
 **/

public class Demo {
    public static void main(String[] args) {
        String s1 = "Hello";
        String s2 = new String("Hello");
        String s3 = new String("World");
        String s4 = s2 + s3;
        System.out.println(s1 == s2.intern());
        System.out.println(s2 == s2.intern());
        System.out.println(s3 == s3.intern());
        System.out.println(s4 == s4.intern());
    }
}
